#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=2e5+1000;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
bool canBeIncreasing(vector<int>& nums) {
     for(int i=0;i<nums.size();i++)
     {
         vector<int>temp;
         bool flag=true;
         for(int j=0;j<nums.size();j++)
         {
             if(i==j) continue;
             temp.push_back(nums[j]);
         }
         for(int j=0;j<temp.size()-1;j++)
         {
            if(temp[j]>=temp[j+1]) flag=false;
         }
         if(flag) return true;
     }
     return false;
}
int main(void){
    vector<int>nums;
    int n;cin>>n;
    for(int i=0;i<n;i++){
        int x;cin>>x;
        nums.push_back(x);
    }
    cout<<canBeIncreasing(nums)<<endl;
   	return 0;
}
